package ru.stepuk.modern.generators;

import java.util.Random;

/**
 *
 * @author ivan
 */
public class DefaultJVMGenerator implements RandomNumberGenerator {

    private Random r;
    private int seed;

    public DefaultJVMGenerator(int seed) {
        setSeed(seed);
    }

    public double nextValue() {
        return r.nextDouble();
    }

    public int getSeed() {
        return seed;
    }

    public void setSeed(int seed) {
        this.seed = seed;
        r = new Random(seed);
    }


}
